//package com.preparation.controller;
//
//import com.preparation.domain.PostLike;
//import com.preparation.dto.R;
//import com.preparation.service.IPostLikeService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//
//@CrossOrigin
//@RestController
//@RequestMapping("/likes")
//public class PostLikeController {
//
//    @Autowired
//    private IPostLikeService likeService;
//
//
//    //点赞 取消点赞
//    @PostMapping("/like")
//    public R like(@RequestBody PostLike postLike){
//        Boolean flag = likeService.like(postLike);
//        return new R(flag, flag ? "操作成功" : "操作失败，请稍后再试");
//    }
//
//    //获取用户点赞列表
//    @GetMapping("/getByUid/{userId}")
//    public R getByUid(@PathVariable Integer userId){
//        return new R(true, likeService.getByUid(userId));
//    }
//
//    //根据用户id和帖子id查询用户点赞信息
//    @GetMapping("/getByUidPid")
//    public R getByUidPid(PostLike postLike){
//        Boolean flag = likeService.getByUidPid(postLike);
//        return new R(flag, flag ? "查询成功" : "查询失败");
//    }
//
//}
